package com.sk.bilibili.test4;

import com.sk.bilibili.apiMapper.annotation.ApiMapper;
import com.sk.bilibili.apiMapper.annotation.FieldPath;
import com.sk.bilibili.apiMapper.annotation.RequestHead;
import com.sk.bilibili.apiMapper.constant.Method;
import com.sk.bilibili.dto.LiveData;
import com.sk.bilibili.test5.RankInfo;
import io.swagger.models.auth.In;

/**
 * @author 邵康
 * @date 2021/11/26 15:09
 */
@RequestHead(key = "referer",value = "https://www.bilibili.com/")
@RequestHead(key = "user-agent",value = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36")
@ApiMapper(value = "https://api.bilibili.com/x/",method = Method.GET)
public interface VideoApi {

    @ApiMapper("web-interface/search/all/v2?context=&page=${page}&order=totalrank&keyword=${keyword}&duration=1&tids_2=&from_source=webtop_search&from_spmid=333.851&platform=pc&__refresh__=true&_extra=&tids=0&highlight=1&single_column=0")
    @FieldPath(value = "data.result[10].data",collection = true)
    BvInfo[] search(Integer page,String keyword);

    @ApiMapper("web-interface/ranking/v2?rid=${rid}&type=all")
    @FieldPath(value = "data.list",collection = true)
    RankInfo[] getRank(Integer rid);

    @ApiMapper("web-interface/view?bvid=${bvId}")
    @FieldPath(value = "data")
    VideoSetInfo getVideoSetInfo(String bvId);

    @ApiMapper("player/playurl?avid=${aid}&amp;cid=${cid}&amp;qn=64")
    @FieldPath(value = "data.durl[0]")
    StreamInfo getStreamInfo(Integer aid, Integer cid);

}
